package com.itheima.day05_method;

public class Demo7_equals {
    public static void main(String[] args) {
        int[] arr1 = {10, 20, 30, 40};
        int[] arr2 = {10, 20, 30, 40};
        boolean equals = equals(arr1, arr2);
        System.out.println("equals = " + equals);
    }
    public static boolean equals(int[] arr1, int[] arr2){
        if (arr1 == null && arr2 == null){
            return true;
        }
        if (arr1.length != arr2.length){
            return false;
        }
        for (int i = 0; i < arr1.length; i++) {
            if (arr1[i] != arr2[i]){
                return false;
            }
        }
        return true;

    }
}
